<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <title>后台管理</title>
    <link rel="stylesheet" type="text/css" href="/resources/easyui/themes/default/easyui.css">
    <link rel="stylesheet" type="text/css" href="/resources/easyui/themes/icon.css">
    <script type="text/javascript" src="/resources/easyui/jquery.min.js"></script>
    <script type="text/javascript" src="/resources/easyui/jquery.easyui.min.js"></script>
</head>
<body>
<form method="post" action="/report">
    开始时间：<input class="easyui-datebox" value="${startDate!''}" name="start"
                data-options="formatter:myformatter,parser:myparser"/>
    结束时间：<input class="easyui-datebox" value="${endDate!''}" name="end"
                data-options="formatter:myformatter,parser:myparser"/>
    <input type="submit" value="查询"/>
</form>
<table>
    <thead>
    <tr>
        <th>昵称</th>
        <th>订单付款数</th>
        <th>订单付款金额</th>
        <th>订单结算数</th>
        <th>订单佣金</th>
        <th>订单失效数</th>
        <th>推广ID</th>
    </tr>
    </thead>
    <tbody>
    <#list records as r>
    <tr>
        <td>${r.nickname!''}</td>
        <td>${r.订单付款数!''}</td>
        <td>${r.订单付款金额!''}</td>
        <td>${r.订单结算数!''}</td>
        <td>
            <#if r.订单佣金??>
            ${((r.订单佣金/2)*0.9)?string('0.00')}
            <#else>
                0
            </#if>
        </td>
        <td>${r.订单失效数!''}</td>
        <td>${r.tgid!''}</td>
    </tr>
    </#list>
    </tbody>
    <tfoot>
    <tr>
        <th></th>
        <th></th>
        <th></th>
        <th>合计</th>
        <th>${heji!''}</th>
        <th></th>
        <th></th>
    </tr>
    </tfoot>
</table>
</body>
</html>
<script>
    function myformatter(date) {
        var y = date.getFullYear();
        var m = date.getMonth() + 1;
        var d = date.getDate();
        return y + '-' + (m < 10 ? ('0' + m) : m) + '-' + (d < 10 ? ('0' + d) : d);
    }
    function myparser(s) {
        if (!s) return new Date();
        var ss = (s.split('-'));
        var y = parseInt(ss[0], 10);
        var m = parseInt(ss[1], 10);
        var d = parseInt(ss[2], 10);
        if (!isNaN(y) && !isNaN(m) && !isNaN(d)) {
            return new Date(y, m - 1, d);
        } else {
            return new Date();
        }
    }
</script>